// default package
// Generated 04.01.2014 16:35:54 by Hibernate Tools 4.0.0
package com.techtransteam.techtransteamWeb.dal.entities;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * UserGroup generated by hbm2java
 */
@Entity
@Table(name = "user_group")
public class UserGroup implements java.io.Serializable {

	private UserGroupId id;
	private User user;
	private Group group;

	public UserGroup() {
	}

	public UserGroup(UserGroupId id, User user, Group group) {
		this.id = id;
		this.user = user;
		this.group = group;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "idUser", column = @Column(name = "id_user", nullable = false)),
			@AttributeOverride(name = "idGroup", column = @Column(name = "id_group", nullable = false)) })
	public UserGroupId getId() {
		return this.id;
	}

	public void setId(UserGroupId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_user", nullable = false, insertable = false, updatable = false)
	public User getUsers() {
		return this.user;
	}

	public void setUsers(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_group", nullable = false, insertable = false, updatable = false)
	public Group getGroups() {
		return this.group;
	}

	public void setGroups(Group group) {
		this.group = group;
	}

}
